Overview | Package | Class | Tree | Deprecated | Index | Help Java Platform
1.1.7
PREV CLASS | NEXT CLASS FRAMES  | NO FRAMES
SUMMARY:  INNER | FIELD | CONSTR | METHOD DETAIL:  FIELD | CONSTR | METHOD

Class com.sun.java.swing.LookAndFeel

java.lang.Object
  |
  +--com.sun.java.swing.LookAndFeel

public abstract class LookAndFeel
extends java.lang.Object
Completely characterizes a look and feel from the point of view of the pluggable look and feel components.


Method Summary
UIDefaults getDefaults()
          This method is called once by UIManager.setLookAndFeel to create the look and feel specific defaults table.
java.lang.String getDescription()
          Return a one line description of this look and feel implementation, e.g.
java.lang.String getID()
          Return a string that identifies this look and feel.
java.lang.String getName()
          Return a short string that identifies this look and feel, e.g.
void initialize()
          UIManager.setLookAndFeel calls this method before the first call (and typically the only call) to getDefaults().
static void installBorder(JComponent c, java.lang.String defaultBorderName)
          Convenience method for installing a component's default Border object on the specified component if either the border is currently null or already an instance of UIResource.
static void installColorsAndFont(JComponent c, java.lang.String defaultBgName, java.lang.String defaultFgName, java.lang.String defaultFontName)
          Convenience method for initializing a components foreground background and font properties with values from the current defaults table.
static void installColors(JComponent c, java.lang.String defaultBgName, java.lang.String defaultFgName)
          Convenience method for initializing a component's foreground and background color properties with values from the current defaults table.
boolean isNativeLookAndFeel()
          If the underlying platform has a "native" look and feel, and this is an implementation of it, return true.
boolean isSupportedLookAndFeel()
          Return true if the underlying platform supports and or permits this look and feel.
static java.lang.Object makeIcon(java.lang.Class baseClass, java.lang.String gifFile)
          Utility method that creates a UIDefaults.
java.lang.String toString()
           
void uninitialize()
          UIManager.setLookAndFeel calls this method just before we're replaced by a new default look and feel.
static void uninstallBorder(JComponent c)
          Convenience method for un-installing a component's default border on the specified component if the border is currently an instance of UIResource.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notifyAll, notify, toString, wait, wait, wait
 

Method Detail

installColors

public static void installColors(JComponent c,
                                 java.lang.String defaultBgName,
                                 java.lang.String defaultFgName)
Convenience method for initializing a component's foreground and background color properties with values from the current defaults table. The properties are only set if the current value is either null or a UIResource.
Parameters:
c - the target component for installing default color/font properties
defaultBgName - the key for the default background
defaultFgName - the key for the default foreground
See Also:
installColorsAndFont, getColor

installColorsAndFont

public static void installColorsAndFont(JComponent c,
                                        java.lang.String defaultBgName,
                                        java.lang.String defaultFgName,
                                        java.lang.String defaultFontName)
Convenience method for initializing a components foreground background and font properties with values from the current defaults table. The properties are only set if the current value is either null or a UIResource.
Parameters:
c - the target component for installing default color/font properties
defaultBgName - the key for the default background
defaultFgName - the key for the default foreground
defaultFontName - the key for the default font
See Also:
installColors, getColor, getFont

installBorder

public static void installBorder(JComponent c,
                                 java.lang.String defaultBorderName)
Convenience method for installing a component's default Border object on the specified component if either the border is currently null or already an instance of UIResource.
Parameters:
c - the target component for installing default border
defaultBorderName - the key specifying the default border

uninstallBorder

public static void uninstallBorder(JComponent c)
Convenience method for un-installing a component's default border on the specified component if the border is currently an instance of UIResource.
Parameters:
c - the target component for uninstalling default border

makeIcon

public static java.lang.Object makeIcon(java.lang.Class baseClass,
                              java.lang.String gifFile)
Utility method that creates a UIDefaults.LazyValue that creates an ImageIcon UIResource for the specified gifFile filename.

getName

public abstract java.lang.String getName()
Return a short string that identifies this look and feel, e.g. "CDE/Motif". This string should be appropriate for a menu item. Distinct look and feels should have different names, e.g. a subclass of MotifLookAndFeel that changes the way a few components are rendered should be called "CDE/Motif My Way"; something that would be useful to a user trying to select a L&F from a list of names.

getID

public abstract java.lang.String getID()
Return a string that identifies this look and feel. This string will be used by applications/services that want to recognize well known look and feel implementations. Presently the well known names are "Motif", "Windows", "Mac", "Organic". Note that a derived LookAndFeel that doesn't make any fundamental changes to the look or feel should not override this method.

getDescription

public abstract java.lang.String getDescription()
Return a one line description of this look and feel implementation, e.g. "The CDE/Motif Look and Feel". This string is intended for the user, e.g. in the title of a window or in a ToolTip message.

isNativeLookAndFeel

public abstract boolean isNativeLookAndFeel()
If the underlying platform has a "native" look and feel, and this is an implementation of it, return true. For example a CDE/Motif look and implementation would return true when the underlying platform was Solaris.

isSupportedLookAndFeel

public abstract boolean isSupportedLookAndFeel()
Return true if the underlying platform supports and or permits this look and feel. This method returns false if the look and feel depends on special resources or legal agreements that aren't defined for the current platform.
See Also:
setLookAndFeel

initialize

public void initialize()
UIManager.setLookAndFeel calls this method before the first call (and typically the only call) to getDefaults(). Subclasses should do any one-time setup they need here, rather than in a static initializer, because look and feel class objects may be loaded just to discover that isSupportedLookAndFeel() returns false.
See Also:
uninitialize, setLookAndFeel

uninitialize

public void uninitialize()
UIManager.setLookAndFeel calls this method just before we're replaced by a new default look and feel. Subclasses may choose to free up some resources here.
See Also:
initialize

getDefaults

public UIDefaults getDefaults()
This method is called once by UIManager.setLookAndFeel to create the look and feel specific defaults table. Other applications, for example an application builder, may also call this method.
See Also:
initialize, uninitialize, setLookAndFeel

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

Overview | Package | Class | Tree | Deprecated | Index | Help Java Platform
1.1.7
PREV CLASS | NEXT CLASS FRAMES  | NO FRAMES
SUMMARY:  INNER | FIELD | CONSTR | METHOD DETAIL:  FIELD | CONSTR | METHOD

Submit a bug or feature
Submit comments/suggestions about javadoc
Java is a trademark or registered trademark of Sun Microsystems, Inc. in the US and other countries.
Copyright 1993-1998 Sun Microsystems, Inc. 901 San Antonio Road,
Palo Alto, California, 94303, U.S.A. All Rights Reserved.